home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / agoodw1a / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-08-26  |  7.6 KB  |  242 lines

  1. VERSION 5.00
  2. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "SHDOCVW.DLL"
  3. Begin VB.Form Form1 
  4.    Caption         =   "Power Browser"
  5.    ClientHeight    =   7395
  6.    ClientLeft      =   165
  7.    ClientTop       =   735
  8.    ClientWidth     =   10755
  9.    Icon            =   "Form1.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   7395
  12.    ScaleWidth      =   10755
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin VB.CommandButton cmdRefresh 
  15.       Caption         =   "Refresh"
  16.       Height          =   255
  17.       Left            =   8160
  18.       TabIndex        =   7
  19.       Top             =   120
  20.       Width           =   975
  21.    End
  22.    Begin VB.CommandButton cmdStop 
  23.       Caption         =   "Stop"
  24.       Height          =   255
  25.       Left            =   7200
  26.       TabIndex        =   6
  27.       Top             =   120
  28.       Width           =   975
  29.    End
  30.    Begin VB.CommandButton cmdForward 
  31.       Caption         =   "Forward"
  32.       Height          =   255
  33.       Left            =   6240
  34.       TabIndex        =   5
  35.       Top             =   120
  36.       Width           =   975
  37.    End
  38.    Begin VB.CommandButton cmdBack 
  39.       Caption         =   "Back"
  40.       Height          =   255
  41.       Left            =   5280
  42.       TabIndex        =   4
  43.       Top             =   120
  44.       Width           =   975
  45.    End
  46.    Begin VB.CommandButton cmdGo 
  47.       Caption         =   "GO!"
  48.       Default         =   -1  'True
  49.       Height          =   255
  50.       Left            =   4320
  51.       TabIndex        =   1
  52.       Top             =   120
  53.       Width           =   855
  54.    End
  55.    Begin SHDocVwCtl.WebBrowser WebBrowser1 
  56.       Height          =   4335
  57.       Left            =   1320
  58.       TabIndex        =   3
  59.       Top             =   840
  60.       Width           =   6735
  61.       ExtentX         =   11880
  62.       ExtentY         =   7646
  63.       ViewMode        =   1
  64.       Offline         =   0
  65.       Silent          =   0
  66.       RegisterAsBrowser=   0
  67.       RegisterAsDropTarget=   1
  68.       AutoArrange     =   -1  'True
  69.       NoClientEdge    =   0   'False
  70.       AlignLeft       =   0   'False
  71.       ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  72.       Location        =   ""
  73.    End
  74.    Begin VB.TextBox txtAddress 
  75.       Height          =   285
  76.       Left            =   0
  77.       TabIndex        =   0
  78.       Text            =   "Http://"
  79.       Top             =   120
  80.       Width           =   4335
  81.    End
  82.    Begin VB.Image Image1 
  83.       Height          =   480
  84.       Left            =   9360
  85.       Picture         =   "Form1.frx":0442
  86.       Top             =   0
  87.       Width           =   480
  88.    End
  89.    Begin VB.Label lblStatus 
  90.       BackColor       =   &H00000000&
  91.       BorderStyle     =   1  'Fixed Single
  92.       Caption         =   "Power Browser - Blocking Pop-Up windows | Coded by:Dustin Davis - Bootleg Software Inc."
  93.       ForeColor       =   &H0000FFFF&
  94.       Height          =   255
  95.       Left            =   0
  96.       TabIndex        =   2
  97.       Top             =   480
  98.       Width           =   7815
  99.    End
  100.    Begin VB.Menu nmuFile 
  101.       Caption         =   "&File"
  102.       Begin VB.Menu mnuexit 
  103.          Caption         =   "Exit"
  104.          Shortcut        =   ^X
  105.       End
  106.    End
  107.    Begin VB.Menu mnuOptions 
  108.       Caption         =   "&Options"
  109.       Begin VB.Menu mnuOptionsAllow 
  110.          Caption         =   "Allow Pop-Up windows"
  111.       End
  112.    End
  113.    Begin VB.Menu mnuAbout 
  114.       Caption         =   "&About Power Browser"
  115.    End
  116. Attribute VB_Name = "Form1"
  117. Attribute VB_GlobalNameSpace = False
  118. Attribute VB_Creatable = False
  119. Attribute VB_PredeclaredId = True
  120. Attribute VB_Exposed = False
  121. '***********************************************************************
  122. 'Coded by: Dustin Davis
  123. 'Bootleg Software Inc.
  124. 'http://www.warpnet.org/bsi
  125. 'Power Browser shows you how to use the web browser control and how to keep pop
  126. 'up windows from appearing!!
  127. 'If you use this in your program, please give me credit
  128. 'PLEASE DO NOT STEAL THIS PROGRAM, I'VE ALREADY RELEASED IT TO THE PUBLIC ON
  129. 'MY SITE!! http://www.warpnet.org/bsi
  130. '***************************************************************************
  131. Public AllowPopup As Boolean 'This is for Pop-up windows
  132. Private Sub cmdBack_Click()
  133. 'Go back one page
  134. WebBrowser1.GoBack
  135. End Sub
  136. Private Sub cmdForward_Click()
  137. 'go forward one page
  138. WebBrowser1.GoForward
  139. End Sub
  140. Private Sub cmdGo_Click()
  141. 'Go to web page
  142. WebBrowser1.Navigate txtAddress.Text
  143. lblStatus.Caption = "Going to: " & txtAddress.Text
  144. End Sub
  145. Private Sub cmdRefresh_Click()
  146. 'Refresh page
  147. WebBrowser1.Refresh
  148. End Sub
  149. Private Sub cmdStop_Click()
  150. 'Stop loading
  151. WebBrowser1.Stop
  152. End Sub
  153. Private Sub Form_Load()
  154. 'Resize and place objects
  155. With WebBrowser1
  156.     .Width = Form1.Width - 200
  157.     .Left = 50
  158.     .Height = Form1.Height - 200
  159. End With
  160. With lblStatus
  161.     .Top = txtAddress.Top + txtAddress.Height + 50
  162.     .Left = WebBrowser1.Left
  163.     .FontBold = True
  164.     .Width = WebBrowser1.Width
  165. End With
  166. txtAddress.Left = 50
  167. cmdGo.Left = (txtAddress.Left + txtAddress.Width) + 20
  168. End Sub
  169. Private Sub Form_Resize()
  170. 'Resizes everything to fit to the form
  171. With WebBrowser1
  172.     .Width = Form1.Width - 200
  173.     .Left = 50
  174.     .Height = Form1.Height - 1500
  175. End With
  176. With lblStatus
  177.     .Top = txtAddress.Top + txtAddress.Height + 50
  178.     .Left = WebBrowser1.Left
  179.     .Width = WebBrowser1.Width
  180. End With
  181. End Sub
  182. Private Sub mnuAbout_Click()
  183. MsgBox "Power Browser" & vbCrLf & "Coded by: Dustin Davis" & vbCrLf & "http://www.warpnet.org/bsi", vbOKOnly, "About Power Browser"
  184. WebBrowser1.Navigate "http://www.warpnet.org/bsi"
  185. End Sub
  186. Private Sub mnuexit_Click()
  187. 'Exit program
  188. Unload Me
  189. End Sub
  190. Private Sub mnuOptionsAllow_Click()
  191. 'Turn on/off pop-up windows
  192. If AllowPopup = True Then
  193.     AllowPopup = False
  194.     mnuOptionsAllow.Checked = False
  195.     lblStatus.Caption = "Power Browser - Blocking Pop-Up windows | Coded by:Dustin Davis - Bootleg Software Inc."
  196. ElseIf AllowPopup = False Then
  197.     AllowPopup = True
  198.     mnuOptionsAllow.Checked = True
  199.     lblStatus.Caption = "Power Browser - Allowing Pop-Up windows | Coded by:Dustin Davis - Bootleg Software Inc."
  200. End If
  201. End Sub
  202. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
  203. 'shows done in the status bar
  204. lblStatus.Caption = "Done Loading"
  205. Form1.Caption = "Power Browser - " & WebBrowser1.LocationName
  206. End Sub
  207. Private Sub WebBrowser1_DownloadBegin()
  208. 'Starting download
  209. lblStatus.Caption = "Starting Download"
  210. End Sub
  211. Private Sub WebBrowser1_DownloadComplete()
  212. 'Done downloading
  213. lblStatus.Caption = "Download Done!"
  214. End Sub
  215. Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
  216. 'Loaded page
  217. lblStatus.Caption = "Done Loading!"
  218. Form1.Caption = "Power Browser - " & WebBrowser1.LocationName  'Shows webpage in title bar
  219. End Sub
  220. Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
  221. 'This will allow a pop-up window to load or to be blocked!
  222. If AllowPopup = True Then
  223.     Cancel = False
  224.     DoEvents
  225. ElseIf AllowPopup = False Then
  226.     Cancel = True
  227. End If
  228. End Sub
  229. Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
  230. 'Shows progress in status bar
  231. lblStatus.Caption = "Reading " & Progress & "  of  " & ProgressMax
  232. End Sub
  233. Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
  234. 'shows new text in status bar
  235. lblStatus.Caption = Text
  236. End Sub
  237. Function FileExist(vFile As String) As Boolean
  238.     On Error Resume Next
  239.     FileExist = False
  240.     If Dir$(vFile) <> "" Then: FileExist = True
  241. End Function
  242.